package ruijie;

import java.util.ArrayList;

public class Main3 {
    public String[] foldPaper(int n) {
        // write code here
        ArrayList<String> list = new ArrayList<>();

        for(int i = 0;i<n;i++){
            x(list);
        }

        return list.toArray(new String[0]);
    }

    public void x(ArrayList<String> list){
        if(list.size() == 0) {
            list.add("down");
            return;
        }

        boolean up = true;

        for(int i = list.size();i>=0;i--){
            list.add(i,up?"up":"down");
            up = !up;
        }
    }

    public static void main(String[] args) {
        for (String s : new Main3().foldPaper(3)) {
            System.out.println(s);
        }
    }
}
